package com.cc.springboot_test.bean.common;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MyError implements Serializable {

    private static final long serialVersionUID = 2195587600223815566L;

    private String code = "";

    private String msg = "";

    private List<MySubError> fields = new ArrayList<>();

    private Map<String, String> data = new HashMap<>();

    public MyError(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public MyError(String code, String msg, List<MySubError> fields) {
        this.code = code;
        this.msg = msg;
        this.fields = fields;
    }

    public MyError(String code, String msg, Map<String, String> data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public MyError(String code, String msg, List<MySubError> fields, Map<String, String> data) {
        this.code = code;
        this.msg = msg;
        this.fields = fields;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<MySubError> getFields() {
        return fields;
    }

    public void setFields(List<MySubError> fields) {
        this.fields = fields;
    }

    public Map<String, String> getData() {
        return data;
    }

    public void setData(Map<String, String> data) {
        this.data = data;
    }
}
